<!--<link rel="stylesheet" href="http://localhost/nusato/pribadi/themes/srabon/css/jquery-ui-1.8.16.custom.css"></link>-->
<!--<script src="<?php print $url?>js/jquery.ui.core.js"></script>-->
<script src="<?php print $url?>js/jquery.ui.datepicker.js"></script>
<script src="<?php print $url?>js/jquery.ui.autocomplete.js"></script>
<script src="<?php print $url?>js/jquery-ui-timepicker-addon.js"></script>
<script src="<?php print $url?>js/jquery.price_format.1.8.min.js"></script>
<script>
  $(document).ready(function(){
    $("#department").change(function(){
      $('#inventory option').remove();
      $.post('<?php print   site_url("mrp/asset/get-inventory-in-department/")?>/'+$("#department").val(),{},function(data){
        var hasil = $.parseJSON(data);
        if(hasil){
          for(var index in hasil) { 
            if (hasil.hasOwnProperty(index)) {
              var r = new Option(hasil[index], index);
              $(r).html(hasil[index]);
              $("#inventory").append(r);
//                console.log(hasil[index]);
            }
          }
        }
      });
    });
  });
</script>
<div id="main-content">
  <div class="container-fluid">
    <div class="row-fluid">
			<div class="span12">
				<div class="nonboxy-widget">
					<div class="widget-head">
						<h5><i class="black-icons blocks_images"></i><?php print $title?></h5>
					</div>
					<div class="widget-content">
						<div class="widget-box">
              <?php print $this->form_eksternal->form_open("", 'class=" form-horizontal well" id="formoutlet"', 
                      array("id_detail" => $detail[0]->id_mrp_inventory_booking))?>
								<fieldset>
									<div class="control-group">
										<label class="control-label">Title</label>
										<div class="controls">
                      <?php print $this->form_eksternal->form_input('title', $detail[0]->title)?>
										</div>
									</div>
									<div class="control-group">
										<label class="control-label">Department</label>
										<div class="controls">
                      <?php print $this->form_eksternal->form_dropdown('id_hrm_department', $department, array($detail[0]->id_hrm_department), "id='department'")?>
										</div>
									</div>
									<div class="control-group">
										<label class="control-label">Inventory</label>
										<div class="controls">
                      <?php print $this->form_eksternal->form_dropdown('id_mrp_inventory_department', $inventory, array($detail[0]->id_mrp_inventory_department), "id='inventory'")?>
										</div>
									</div>
									<div class="control-group">
										<label class="control-label">Date</label>
										<div class="controls">
                      <?php
                      print $this->form_eksternal->form_date("tanggal", $detail[0]->tanggal, "tanggal")?>
										</div>
									</div>
                  <div class="control-group">
										<label class="control-label">Time</label>
										<div class="controls">
                      <?php print $this->form_eksternal->form_input("timein", $detail[0]->timein, "id='timein'")?>
										</div>
									</div>
									<div class="control-group">
										<label class="control-label">Finish</label>
										<div class="controls">
                      <?php
                      print $this->form_eksternal->form_date("finish", $detail[0]->finish, "finish")?>
										</div>
									</div>
                  <div class="control-group">
										<label class="control-label">Time</label>
										<div class="controls">
                      <?php print $this->form_eksternal->form_input("timeout", $detail[0]->timeout, "id='timeout'")?>
										</div>
									</div>
									<div class="control-group">
										<label class="control-label">PIC</label>
										<div class="controls">
                      <?php print $this->form_eksternal->form_input('pic', $detail[0]->pic)?>
										</div>
									</div>
									<div class="control-group">
										<label class="control-label">Note</label>
										<div class="controls">
                      <?php print $this->form_eksternal->form_textarea('note', $detail[0]->note)?>
										</div>
									</div>
                  <div class="control-group">
										<label class="control-label">Status</label>
										<div class="controls">
                      <?php print $this->form_eksternal->form_dropdown('status', array(1 => "Submitted", 2 => "Accepted", 3 => "Rejected"), array($detail[0]->status))?>
										</div>
									</div>
                  <div class="control-group">
                    <label class="control-label" for="input01">Price</label>
                    <div class="controls">
                      <?php print $this->form_eksternal->form_input_price("price", 'price', $detail[0]->price)?>
                    </div>
                  </div>
                  <div class="control-group">
										<label class="control-label">No Transaksi</label>
										<div class="controls">
                      <?php print $this->form_eksternal->form_input('notransaksi', $detail[0]->notransaksi)?>
										</div>
									</div>
								</fieldset>
								<div class="form-actions">
									<button class="btn btn-primary" type="submit"><?php print lang("save")?></button>
									<button class="btn" onclick="history.go(-1);return false;"><?php print lang("cancel")?></button>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
  </div>
</div>
<script>
  $('#timein').timepicker();
  $('#timeout').timepicker();
</script>